<?php

namespace App\Common\Model;

use think\Model;
use think\facade\Request;

class Files extends Model
{
    protected $name = 'files';

    protected $append = [
        'path_text',
    ];

    public function getPathTextAttr($value,$data){
        $domain = Request::domain();
        $path = $data['path'] ?? '';
        if(!empty($path)){
            return $domain . '/' . $path;
        }
        return $domain;
    }
}